package com.googlecode.bipol.war.services;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import com.googlecode.bip.entity.ISurveyEntry;

/**
 * TODO: Doc
 *
 */
public interface SurveyManager extends Serializable
{
    /**
    * Return the survey 'of the day' filled by the user, or a new empty one if no one exists yet
    * @param idlocal Code id for localization
    * @return The survey model
    * @throws ServiceException
    */
    public List<ISurveyEntry> fetchSurvey(String idlocal) throws ServiceException;
    
    /**
     * Save a survey filled by a BIP_USER
     * @param survey The survey model, as returned by fetchSurvey
     * @return A survey model
     * @throws ServiceException
     */
    public List<ISurveyEntry> postSurvey(List<ISurveyEntry> survey) throws ServiceException;
    
    /**
     * Return the tree model of the survey
     * @return A survey tree model
     * @throws ServiceException
     */
    public Map<String,Object> getSurveyTree() throws ServiceException;
}
